﻿using MediatR;
using RBAC.LuFang.API.Application.Command.GoodsCommand;
using RBAC.LuFang.Domain.Traceability;
using RBAC.LuFang.Domin.Services.TraceabilityService;

namespace RBAC.LuFang.API.Application.CommandHandlers.GoodsHandler
{
    //商品显示
    public class GoodsSelectCommandHandler : IRequestHandler<GoodsSelectCommand, Goodspage>
    {
        private readonly IGoodsService _goodsService;

        public GoodsSelectCommandHandler(IGoodsService goodsService)
        {
            _goodsService = goodsService;
        }

        public async Task<Goodspage> Handle(GoodsSelectCommand request, CancellationToken cancellationToken)
        {
            return await _goodsService.GetGoods(request.pageindex,request.pagesize,request.goodsName,request.goodsProductionBatch,request.goodsperiod,request.goodsNumber,request.goodsQiYe);
        }
    }
}
